/**
 * Copyright (c) suzuki ryoutoku
 * All Rights Reserved
 * @file Bitmap.h
 * @author suzuki ryoutoku
 */

//=============================================================================
//	Protected multiple include file
//=============================================================================
#ifndef BITMAP_H
#define BITMAP_H

//=============================================================================
//	alias
//=============================================================================

typedef unsigned short WORD;
typedef unsigned char BYTE;
typedef unsigned long DWORD;
typedef unsigned long LONG;


//=============================================================================
//	define struct
//=============================================================================
/**
 * Head data of BITMAP file
 * @author suzuki ryoutoku
 * @version 1.0
 */
typedef struct tagBITMAPFILEHEADER {
        WORD    bfType;
        DWORD   bfSize;
        WORD    bfReserved1;
        WORD    bfReserved2;
        DWORD   bfOffBits;
} BITMAPFILEHEADER, *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER;



/**
 * DIB's infomation
 * @author suzuki ryoutoku
 * @version 1.0
 */
typedef struct tagBITMAPINFOHEADER{
        DWORD      biSize;//!< BITMAPINFOHEADER's size
        LONG       biWidth;//!< image's width
        LONG       biHeight;//!< image's height
        WORD       biPlanes;//!< a number of plane(always 1)
        WORD       biBitCount;//!< bits per 1 Pixel( 0 1 4 8 16 24 32)
        DWORD      biCompression;//!<compressing type(no compressing is BI_RGB)
        DWORD      biSizeImage;//!< always 0
        LONG       biXPelsPerMeter;//!< always 0
        LONG       biYPelsPerMeter;//!< always 0
        DWORD      biClrUsed;//!< always 0
        DWORD      biClrImportant;//!< a number of color table
} BITMAPINFOHEADER, *LPBITMAPINFOHEADER, *PBITMAPINFOHEADER;


/**
 * Color table
 * \note
 * This struct represent color table.\n
 * A struct represent a color table. \n
 * Says, when 16 colors struct datas are 16 256 colors are 256 sruct datas
 * @author suzuki ryoutoku
 * @version 1.0
 */
typedef struct tagRGBQUAD {
        BYTE    rgbBlue;
        BYTE    rgbGreen;
        BYTE    rgbRed;
        BYTE    rgbReserved;
} RGBQUAD;
typedef RGBQUAD LPRGBQUAD;

/**
 * Second data of Bitmap file
 * \note
 * This have DIB infomation and color table \n
 * @author suzuki ryoutoku
 * @version 1.0
 */
typedef struct tagBITMAPINFO {
    BITMAPINFOHEADER    bmiHeader;
    RGBQUAD             *bmiColors;
} BITMAPINFO, *LPBITMAPINFO, *PBITMAPINFO;



//=============================================================================
//	Include Gard
//=============================================================================

#endif
